import axios from '../utils'

const api = {
    getAllDataByPage: '/lists/getAllDataByPage',
    getDownload: '/lists/export',
    getDelete: '/lists/del',
    getAdd: '/lists/add',
    getEmpty: '/lists/empty'
}

export default api

export function getAllDataByPage(parameter) {//获取全部数据的接口
    return axios({
        url: api.getAllDataByPage,
        method: 'get',
        params: parameter
    })
}

export function getDownload(parameter) {//下载数据
    return axios({
        url: api.getDownload,
        method: 'get',
        params: parameter,
        responseType: 'blob'
    })
}

export function getDelete(parameter) {//删除数据
    return axios({
        url: api.getDelete,
        method: 'post',
        data: parameter,
    })
}

export function getAddData(parameter) {//添加数据
    return axios({
        url: api.getAdd,
        method: 'post',
        data: parameter,
    })
}

export function getEmptyData(parameter) {//清空数据
    return axios({
        url: api.getEmpty,
        method: 'post',
        data: parameter,
    })
}
